# -*- coding:utf-8 -*-
# @time    : 2021/9/5 6:09
# @Author  : zhang jin xia
# @Filename: PyCharm

from appium.webdriver.common.mobileby import MobileBy
from faker import Faker

from app_po_project.app_project.page.base_page import BasePage


class EditMemberPage(BasePage):
    # 提取元素
    _name_ele=(MobileBy.XPATH, "//*[contains(@text,'必填')]")
    _phonenum_ele=(MobileBy.XPATH, "//*[contains(@text,'手机号')]")
    _save_ele=(MobileBy.ID, "com.tencent.wework:id/gur")

    def edit_member(self,name,phonenum):
        from app_po_project.page.add_member_page import AddMemberPage
        """
        输入姓名
        输入手机号码
        点击保存
        :return:
        """
        self.find(*self._name_ele).send_keys(name)
        self.find(*self._phonenum_ele).send_keys(phonenum)
        self.find_and_click(*self._save_ele)
        # 返回添加成员页面
        return AddMemberPage(self.driver)

